package com.ciei.dpagm.controller;

import com.alibaba.fastjson.JSONObject;
import com.ciei.dpagm.common.controller.BaseController;
import com.ciei.dpagm.service.CircuitGenerationModuleChipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/circuitGenerationModuleChip")
public class CircuitGenerationModuleChipController extends BaseController {

    @Autowired
    private CircuitGenerationModuleChipService circuitGenerationModuleChipService;

    @PostMapping("/importChipModuleTargetFromExcelAll")
    public JSONObject importChipModuleTargetFromExcelAll(HttpServletRequest request) {
        return circuitGenerationModuleChipService.importChipModuleTargetFromExcelAll(request);
    }

    @PostMapping("/importChipModuleTargetFromExcelIncrement")
    public JSONObject importChipModuleTargetFromExcelIncrement(HttpServletRequest request) {
        return circuitGenerationModuleChipService.importChipModuleTargetFromExcelIncrement(request);
    }

    @PostMapping("/exportExcel")
    public void exportExcel(HttpServletResponse response) {
        circuitGenerationModuleChipService.exportChipModuleTargetToExcel(response);
    }

}
